React Option.js 您所在的位置:网站首页 legend react翻译 React Option.js

React Option.js

2023-05-14 01:03| 来源: 网络整理| 查看: 265

我在react中使用react-chartjs-2构建了一个自动图表,有一秒钟我添加了options: {legend: {display: false}},我开始出现这个错误,我从上面的代码中删除了代码,错误并没有消失。

有谁可能有线索吗?

./node_modules/react-select/src/components/Option.js SyntaxError: C:\Users\HP\Desktop\myTable\my-app\node_modules\react-select\src\components\Option.js: Unexpected token, expected "," (3:14) 1 | // @flow 2 | /** @jsx jsx */ > 3 | import { type Node } from 'react'; | ^ 4 | import { jsx } from '@emotion/core'; 5 | 6 | import type { CommonProps, PropsWithStyles, InnerRef } from '../types';

这是我的代码,如果需要的话,可以帮助你更好地理解。

render() { let alphabet = ['B','C','D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; const data = { labels: [...this.state.rows.map(x => x.A)], datasets: alphabet.map(value => { let color = this.state.color[value] || this.state.color.DEFAULT, checkIfUndefined = () => { if (this.state.rows[0][value] === undefined) { return '' } else {return this.state.rows[0][value];} } return{ label: this.state.rows[0][value], data: this.state.rows.map(x => x[value]), backgroundColor: `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})` }}) }; return ( this.state.rows[i]} rowsCount={this.state.rows.length} onGridRowsUpdated={this.onGridRowsUpdated} enableCellSelect={true} /> New row ); } }


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有